package com.xy.model;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Cacheable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

/*
 * @类别表
 */
@SuppressWarnings("serial")
@Entity
@Table
@Cacheable
public class Category extends Identified implements Serializable {
  @Column(nullable = false)
  private String name;// 名称
  private String remark;// 备注
  // 对应到班级
  @OneToMany(targetEntity = BJi.class, mappedBy = "category")
  
  private Set<BJi> bJis = new HashSet<BJi>();
  // 对应到班级套书
  @OneToMany(targetEntity = PackageBook.class, mappedBy = "category") // 套书
  private Set<PackageBook> packageBooks = new HashSet<PackageBook>();

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getRemark() {
    return remark;
  }

  public void setRemark(String remark) {
    this.remark = remark;
  }

  public Set<BJi> getbJis() {
    return bJis;
  }

  public void setbJis(Set<BJi> bJis) {
    this.bJis = bJis;
  }

  public Set<PackageBook> getPackageBooks() {
    return packageBooks;
  }

  public void setPackageBooks(Set<PackageBook> packageBooks) {
    this.packageBooks = packageBooks;
  }

  public Category() {
    super();
    // TODO Auto-generated constructor stub
  }

}
